package service.impl;

import common.consts.Commons;
import dao.TradeCategoryDao;
import domain.TradeCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.ServiceResponse;
import service.TradeCategoryService;

import java.util.List;

/**
 * Created by aceyin on 15/7/9.
 */
@Service
public class TradeCategoryServiceImpl extends ServiceBase implements TradeCategoryService {

    @Autowired
    private TradeCategoryDao tradeCategoryDao;

    @Override
    public ServiceResponse listNormal() {
        List<TradeCategory> categoryList = tradeCategoryDao.findByStatus(Commons.Status.NORMAL);
        return ServiceResponse.success().with("tradeCategories", categoryList);
    }
}
